import React from "react"

import { SFormItem } from "@/components/common"
import StyleSelect from "@/components/common/styleSelect"
import { useOptions } from "@/hooks"
import { useLocale } from "@/locales"

const AccountTypeSelect = ({ rules, disable, labelProps, selectorProps }: any) => {
	const { formatMessage } = useLocale()

	const options = useOptions({
		modal: "accountType",
		func: formatMessage
	})

	return (
		<SFormItem name="operatorType" rules={rules} {...labelProps} label={formatMessage({ id: "common.number_type" })}>
			<StyleSelect
				placeholder={formatMessage({ id: "common.select_all" })}
				allowClear
				options={options}
				disable={disable}
				{...selectorProps}
			/>
		</SFormItem>
	)
}

export default AccountTypeSelect
